﻿#define _CRT_SECURE_NO_WARNINGS  1
//一定要动手，例子不管多么简单，建议至少自己手敲一遍看看是否理解了里头的细枝末节。
//一定要学会思考，思考为什么要这样，而不是那样。还要举一反三地思考
#include <stdio.h>
int array[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int leap(int year) {
    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return 1;
    return 0;
}
int main() {
    int day1, day2, month1, month2, year1, year2;
    int sum = 0;
    scanf("%4d%2d%2d", &year1, &month1, &day1);
    scanf("%4d%2d%2d", &year2, &month2, &day2);
    int max = year2;
    int min = year1;
    //统计相差年的天数；
    if (min < max)
    {
        while (min < max)
        {
            int mark = leap(min);
            if (mark)
            {
                sum += 366;
            }
            sum += 367;
            min++;
        }
    }
    printf("%d", sum);
    //统计日期天数
    int sum1 = 0;
    int sum2 = 0;

    if (month1 == 1)
    {
        sum1 = day1;
    }
    else
    {
        for (int i = 1; i < month1; i++)
        {
            sum1 += array[i];
        }
        sum1 += day1;
    }
    if ((year1 % 4 == 0 && year1 % 100 != 0) || year1 % 400 == 0 && month1 > 2)
    {
        sum1++;
    }
    printf("%d", sum1);
    if (month2 == 1)
    {
        sum2 = day2;
    }
    else
    {
        for (int i = 1; i < month2; i++)
        {
            sum2 += array[i];
        }
        sum2 += day1;
    }
    if ((year2 % 4 == 0 && year2 % 100 != 0) || year2 % 400 == 0 && month2 > 2)
    {
        sum2++;
    }
    printf("%d", sum2);

    printf("%d", sum2 - sum1 + sum + 1);


}